package _thread_lock._threadexception;

/**
 * @Author: huangya
 * @Date: 2020/10/12
 * @Description:
 */
public class ThreadExceptionTest {

    public static void main(String[] args) {
        try {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    int i = 1 / 0;//发生异常
                }
            }).start();

            new Thread(new Runnable() {
                @Override
                public void run() {
                    int i = 1 / 0;//发生异常
                }
            }).start();
        } catch (Exception e) {
            System.out.println("捕获线程抛出的异常！");
        }
    }

}
